<?php
class document_xhtml extends document {
	
	function __construct() {
		$this->addJS("styles/js/jquery.js");
		$this->addMeta("http-equiv='Content-type' content='application/xhtml+xml; charset=UTF-8'");
		$this->addMeta("name='language' http-equiv='Content-language' content='".config::getInstance()->lang."'");
		$this->addHTTPHeader("Content-type: application/xhtml+xml; charset=utf-8");
		$this->addHTTPHeader("Content-language: ".config::getInstance()->lang);
		parent::__construct();
	}
	
	function output_header() {
		// load style before headers in order to get css/js right etc...
		ob_start();
		style::load(config::getInstance()->style);
		$this->body = ob_get_contents();
		ob_end_clean();
		
		foreach ($this->httpheaders as $header) {
			header($header);
		} ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='<?php echo config::getInstance()->lang; ?>' lang='<?php echo config::getInstance()->lang; ?>'>
<head>
	<title><?php echo config::getInstance()->sitename; ?></title>
<?php foreach ($this->meta as $meta) { ?>
	<meta <?php echo $meta; ?> />
<?php }
foreach ($this->css as $css) { ?>
	<link rel="stylesheet" type="text/css" href="/<?php echo $css; ?>" />
<?php }
foreach ($this->js as $js) { ?>
	<script type="text/javascript" src="/<?php echo $js; ?>"></script>
<?php } ?>
</head>
<body>
		<?php
	}
	
	function output_body() {		
		echo $this->body;
	}
	
	function output_footer() {
		?>

</body>
</html>
		<?php
	}
}
?>